var e = getApp();

Page({
    data: {
        page: 1,
        info: []
    },
    onLoad: function(e) {
        this.getdata();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var e = this.data.page + 1;
            this.setData({
                page: e
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    getdata: function() {
        var t = this, a = e.getNetAddresss("plugin.reserve-fund.api.receive-log.index");
        e._getNetWork({
            url: a,
            data: {
                page: t.data.page
            },
            success: function(e) {
                var a = e.data;
                1 == a.result ? t.setData({
                    info: a.data.getReceive.list.data,
                    current_page: a.data.getReceive.list.current_page,
                    last_page: a.data.getReceive.list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getMore: function() {
        wx.showLoading({
            title: "加载中"
        });
        var t = this, a = e.getNetAddresss("plugin.reserve-fund.api.receive-log.index");
        e._getNetWork({
            url: a,
            data: {
                page: t.data.page
            },
            success: function(e) {
                var a = e.data;
                wx.hideLoading({
                    success: function(e) {},
                    fail: function(e) {},
                    complete: function(e) {}
                }), 1 == a.result ? t.setData({
                    info: t.data.info.concat(a.data.getReceive.list.data),
                    current_page: a.data.getReceive.list.current_page,
                    last_page: a.data.getReceive.list.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    }
});